package com.spsy.pay.config;

import java.io.FileWriter;
import java.io.IOException;


public class AlipayConfig {

    //↓↓↓↓↓↓↓↓↓↓请在这里配置您的基本信息↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓

    // 应用ID,您的APPID，收款账号既是您的APPID对应支付宝账号
    //public static String app_id = "2021000122669503";


    //arhat
    public static String app_id = "9021000133628817";



    // 商户私钥，您的PKCS8格式RSA2私钥
    //public static String merchant_private_key = "MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQDnS97J1eX2pXu+0E0ksZCN9hw8sWUkaXRa2H33JODPOO/YdfOqa64tPLSG/+s82l/gA49Hv5S/29k/ptkBfuPYO9KDDGBZd08No5uqJNUikZG3Cg3f3bcOAv5DhWfDyWLrwAS48Vp5DFCvjhkmrpyQu6nmqEquHARy1zsKLhwy5HyBKAFMJng5oXrP7w7+qALaIGBS8bXfhnRz2rhpe1mZSH5OWPyQUQuUf0Fp5DRJkyuU/x5ebatyvdqX1tuho7nT86nXGDbuI6a6doez//P2zSL3Hg6+E2Jv5m0F6NNwAuLq2ZW8hMvYzQNSj/HtO1+tkCTy1SiEdrTHMYZYnXS7AgMBAAECggEAGPDyfjtFh/pCRMo7d1h6aQR/+P98E5gXhvBPbQYaA9505peZhegEqTYhlWklWbOGoSZhHfCHvsSbQaThQ6sGMLwKsDz2as9Vw/e/gnJkVUzzNJSt+FT1N1qVRnytOsyNkTRsjfDgu6rbTIL7LVOo6GaEJK5DF1FIHYYeBLQCMG6EgdrWnDKxnTcJ+sivvlLR3ea7CKV+utwpJs2PMZ/KvCSZcDWF1qdeq9nDZz236Zjn4KDpHPMpKFOo1rGslKU9AUQZRUp1YpkCYvYjqq5s3numrqwM128jPPjzbAJ5mdICLP0qgrNXyUfmj6vxCZ+zTv87y2mxDNHI0hejHJW3KQKBgQD+pw89OVFHbi+BeASMVTxUtBqDiJIruO9hj0WDmCCZSxEVOXcCz2vuBrtElvzvAVWyzvzQdZZe61JoR6AQ2evnA8K2KRhnCtRiBJak6bOHeH6MjrT6f1yRC4iXHiZd8PPeHb2Noey7MxMvDMPThRcsWtsQ/wbxlQoZXuZDimEWhQKBgQDohSxrSRYcsXwS2h6npZi8pgT1jferdvDECHStONlX8cuMaFiJjyaiWHaaOFQC+sMWZ28Ys1PDXVVOp8lrdhxARBtFIotAsItm6FpNen3+2DKm/LAY3Tv0onwtdjwwJssPtHbdeORouSdXmkqW+nZlk+RlG8etaGJw4lGFO9JiPwKBgBi7Zup+T5uNYwXC/0YV3Sco2s5djDy82Fr0TD8MnlXlCYKzMxDNzmCuvK9brrMTwRv9qGYilXkgh79i/XPFhnjIT7fbY+hWD+x5H5xiqjIFDN1f2sndZsMbiKeMoRNMnJK89rTzvgcsXbebGMXJTkfbhx0ud6Es5W8zXU+/98/1AoGAP/ZCXdDhEEuSge0Wea+H8H0K6DGBa91wJbzdu7jjsNmG0LzzfgOu8QG8vne4RImOmN8jJHxQEnHeQaDOO41mABe8GKyD+euWrVxFWwLTHgODC4R/PJe/InCAEFFyBRzmxw8xk4Lp8hTcybBbzGRhpVelgFq/9ue8DKl1G111ZikCgYB0hKL01AvOH90IZWLgPB6D0CLqEm89PcdfOn4wNje8d+3+Ni/ELsEoxwYeMOdtKf6+xun4V0Pi/EG1cp2AghxUWpbDst4rlFNyCoqq8dRS12UddVA1NqiMoR+EBXo6W7tEt2WLmz3olP9tlaU1nZIphCgjTeL5zHwtiYm2nEyHcA==";

    // 支付宝公钥,查看地址：https://openhome.alipay.com/platform/keyManage.htm 对应APPID下的支付宝公钥。
    //public static String alipay_public_key = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAkPDPXCJ38XSn1S2YIViz2fgFmaMYEKt+LNxGEu81vB/NDedTcUYHjtxkSs1+WL+MtgsnWJj2pqCUKZ/9DqDuEPyaUmi9nSA+iFJWDYkxbzwQm0xVNorkwELAvcjATOkjh8ld4hfMC515RzOJTTf1Xk2O13eDVT/4W1oWu1KA34QmDZqj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b3f1boHuAZjh0215jRoEQuAFGZ6f3t6YrimmF92dbYwwnOxLl1U8/Visuptwi/hHlfqZowIDAQAB";





    // 用来接收支付结果（异步回调路径）
    // 服务器异步通知页面路径  需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    // public static String notify_url = "http://工程公网访问地址/alipay.trade.page.pay-JAVA-UTF-8/notify_url.jsp";
    public static String notify_url = "https://288b-221-221-160-183.ngrok-free.app/alipay/result";

    // 支付完成之后的跳转路径（同步回调路径）
    // 页面跳转同步通知页面路径 需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    //public static String return_url = "http://工程公网访问地址/alipay.trade.page.pay-JAVA-UTF-8/return_url.jsp";
    public static String return_url = "http://localhost/paysuccess.html";

    // 签名方式
    public static String sign_type = "RSA2";

    // 字符编码格式
    public static String charset = "utf-8";

    // 支付宝网关
    public static String gatewayUrl = "https://openapi-sandbox.dl.alipaydev.com/gateway.do";

    // 支付宝网关
    public static String log_path = "C:\\";


//↑↑↑↑↑↑↑↑↑↑请在这里配置您的基本信息↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

    /**
     * 写日志，方便测试（看网站需求，也可以改成把记录存入数据库）
     * @param sWord 要写入日志里的文本内容
     */
    public static void logResult(String sWord) {
        FileWriter writer = null;
        try {
            writer = new FileWriter(log_path + "alipay_log_" + System.currentTimeMillis()+".txt");
            writer.write(sWord);
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            if (writer != null) {
                try {
                    writer.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }
}
